package com.dsh.authorityManagement.controller;

import com.dsh.authorityManagement.entity.AdminDoctor;
import com.dsh.authorityManagement.entity.vo.AdminOfficeVo;
import com.dsh.authorityManagement.service.DoctorService;
import com.dsh.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "医生")
@RestController
@RequestMapping("doctor")
public class DoctorController {
    @Resource
    DoctorService doctorService;
//    @ApiOperation( value = "添加医生信息",response = AdminDoctor.class)
//    @PostMapping("insert")
//    public Result insert(@RequestBody AdminDoctor adminDoctor){
//        int insert = doctorService.insert(adminDoctor);
//        return Result.success(insert,"");
//    }
    @ApiImplicitParam(paramType="query", name = "id", value = "人员id", required = true, dataType = "int")
    @ApiOperation( value = "根据用户id査医生")
    @GetMapping("selectById")
    public Result selectById(int id){
        AdminOfficeVo adminOfficeVo = doctorService.selectById(id);
        return Result.success(adminOfficeVo,"");

    }
    @ApiOperation( value = "修改医生信息",response = AdminDoctor.class)
    @PostMapping("update")
    public Result update(@RequestBody AdminDoctor adminDoctor){
         this.doctorService.update(adminDoctor);
        return Result.success("");
    }
}

